﻿<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<KLS.PPDS.Web.Models.ArticleContentViewModel>" %>
<%@ Import  Namespace="KLS.PPDS.Utilities" %>
<%@ Import Namespace="KLS.PPDS.Resources" %>
<%@ Import Namespace="KLS.PPDS.Utility.Html" %>

  <%
            var height = KLS.PPDS.Utility.WebConfig.ThumbnailsHeight;
            var width = KLS.PPDS.Utility.WebConfig.ThumbnailsWidth;
            var thumbContentId = "thumbs_" + Model.Id;
        %>

      <%foreach (var item in Model.Images) 
              {%>
            
        <div class="thumbnils" >                     
               

                <%
                    
                var imageSource = item.DiskFileName;
                var thumbs = item.ImageIndex.ToString() + item.Name;
                    
                var title = CommonString.FileName + item.Name + "\n" + CommonString.Size + item.Size + " " + CommonString.Megabyte;

                var source = string.Format("/ArticleContent/ShowThumbnailImage?pubId={0}&artId={1}&conId={2}&file={3}", Model.PublicationId, Model.ArticleId, Model.Id, thumbs);
                var deleteHref = string.Format("/ArticleContent/DeleteImage?pubId={0}&artId={1}&conId={2}&file={3}", Model.PublicationId, Model.ArticleId, Model.Id, imageSource);

                var sourceOriginalImage = string.Format("/ArticleContent/ViewImage?pubId={0}&artId={1}&conId={2}&file={3}", Model.PublicationId, Model.ArticleId, Model.Id, imageSource);
                  //var sourceOriginalImage = string.Format("/ArticleContent/ShowOriginalImage?pubId={0}&artId={1}&conId={2}&file={3}", Model.PublicationId, Model.ArticleId, Model.Id, item.FileName);
                %>
                <%if (Model.IsGraphicsDisable.Equals(false))
                {%>
                    <%:Html.DivActionLink("", "", new { @class = "delete-article-image-button", @href = deleteHref, @target = "div#img_thumbs_" + Model.Id, @message = CommonMessage.DeleteConfirmation })%>
                 <%} %>
                
                <a href="<%:sourceOriginalImage %>" rel="shadowbox[<%:Model.Id%>]" class="shadow-image" target="_blank" >
                     <img src="<%:source %>" name="" alt="thumbnail.png" title="<%:title %>"  class ="thumbnils-image"  height="<%:height %>" width="<%:width %>" />
                </a>
                <%--<img src="<%:imageSource%>" name="" alt="thumbnail.png" class ="thumbnils-image" />--%> 
                <br />
                <%  
                    var cutout = string.Empty;

                    if (item.Cutout) 
                    {
                        cutout = "checked";
                    }

                    var retouched = string.Empty;

                    if (item.Retouch)
                    {
                        retouched = "checked";
                    }


                    var chkdisable = Model.IsGraphicsDisable.Equals(false) ? "" : "disabled";
                        //var fillout = Model.Contains("fillout");
                    
                 %>


                <input <%:chkdisable %> type="checkbox" name="chk.<%:CommonConstant.Cutout %>*<%: item.ImageIndex + item.Name %>" class="checkbox"  <%:cutout %>   /><label><%:KLS.PPDS.Resources.CommonString.Fillout %></label>
                 <br />                                         
                <input <%:chkdisable %> type="checkbox" name="chk.<%:CommonConstant.Retouch %>*<%: item.ImageIndex + item.Name %>" class="checkbox" <%:retouched %> /><label><%:KLS.PPDS.Resources.CommonString.Retouch%></label>                                       
       </div>
    
        
   <%}%>
      